<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVipInfosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vip_infos', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')->default(0)->comment('用户id');
            $table->decimal('price')->default(0)->comment('价格');
            $table->string('type')->nullable()->comment('会员类型 num：数量会员 time：时间会员');
            $table->integer('num')->default(0)->comment('次数,会员类型为num时使用');
            $table->timestamp('end_time')->nullable()->comment('到期时间,会员类型为time时使用');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('vip_infos');
    }
}
